#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	getline(cin, s);
	
	int i = -1, len = s.size();
	s += " ";
	while(i < len)
	{
		int j = s.find(' ', i+1);
		string t(s, i+1, j-i-1);
		reverse(t.begin(), t.end());
		if(j < len)
			cout<<t<<" ";
		else
			cout<<t;
		i = j;
	}
    return 0;
}

